import { defineStore } from "pinia";
import { reqData } from "@/api/home";
import type { ReportDataModel } from "@/api/home";

export interface stateType {
  reportData: ReportDataModel | null;
}

export default defineStore("reportData", {
  state: (): stateType => {
    return {
      reportData: null,
    };
  },
  actions: {
    async getReportData() {
      const res = await reqData();
      this.reportData = res;
    },
  },
});
